<template>
  <div class="pagination">
    <el-pagination
      background
     @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="page"
      :page-sizes="pageSizes"
      :page-size="pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total">
    
    </el-pagination>
  </div>
</template>
<script>
export default {
  //  props: ['page','pageSize','pageSizes','total'],
  props:{
    page:{
      default(){return 1},
      type: Number
    },
    pageSize:{
      default(){return 20},
      type:Number
    },
      total:{
        default(){return 0},
        type:Number
      },
    pageSizes:{
      default(){return [20, 40, 60, 80, 100]},
      type: Array()
    },
  },
  methods: {
       handleSizeChange(val) {
        // console.log(`每页 ${val} 条`);
        this.$emit('changepagesize',val)
      },
      handleCurrentChange(val) {
      this.$emit('changepage',val)

      }
  },
  data() {
    return {
      // currentPage4: 1,
    };
  },
};
</script>
<style lang="less" scoped>
.pagination {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: right;
}
</style>